package com.fit.entities.homeworkRecords;

import java.io.Serializable;

import javax.persistence.Embeddable;
import javax.persistence.ManyToOne;

import com.fit.entities.course.Course;
import com.fit.entities.homework.Homework;
import com.fit.entities.user.User;

@Embeddable
public class HomeworkRecordsPk implements Serializable {

	@ManyToOne
	private Homework homework;
	@ManyToOne
	private User user;

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Homework getHomework() {
		return homework;
	}

	public void setHomework(Homework homework) {
		this.homework = homework;
	}

	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;

		HomeworkRecordsPk that = (HomeworkRecordsPk) o;

		if (homework != null ? !homework.equals(that.homework)
				: that.homework != null)
			return false;
		if (user != null ? !user.equals(that.user)
				: that.user != null)
			return false;

		return true;
	}
}
